package linc.cool.config;

import com.google.gson.Gson;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author yqlin
 * @date 2022/3/4 1:25 上午
 * @description
 */
@Slf4j
@Component
public class RabbitMQListener {

    @RabbitListener(queues = "boot_queue")
    public void listenQueue(Message message) {
        log.info("message: {}", new Gson().toJson(message.getBody()));
    }
}

